###############################################################################
#
# file: ImageReader.py
# author: Victor Bos
# 
# Copyright 2007--2011 Victor Bos
#
# This file is part of GREATOR.
#
#    GREATOR is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    GREATOR is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with GREATOR.  If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
import os
import sys

class ImageReader:

    tmpprefix = 'irtmp'

    def __init__(self, data=None):
        self.set_image_data(data)

    def remove_image_data(self):
        self.image_data = None

    def get_image_data(self):
        return self.image_data
    
    def set_image_data(self, image_data):
        self.remove_image_data()
        self.image_data = image_data

    def __copy__(self):
        image_data = self.get_image_data()
        if image_data is None:
            return ImageReader()
        return ImageReader(image_data)

    def has_data(self):
        return self.get_image_data() is not None



    
